package org.android.bbdroid.webservice.data;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class TopicForum extends Forum
{
  private boolean isAuthPost;
  private Map<Integer, TopicInfo> topics;

  public TopicForum(int id, String name, String description, boolean isAuthPost)
  {
    super(id, name, description);
    this.isAuthPost = isAuthPost;
    this.topics = new HashMap<Integer, TopicInfo>();
  }

  public TopicForum(int id, String name, boolean isAuthPost)
  {
    this(id, name, "", isAuthPost);
  }

  public void addTopic(TopicInfo info)
  {
	topics.put(info.getId(), info);
  }

  public boolean isAuthPost()
  {
    return this.isAuthPost;
  }

  public Iterator<TopicInfo> topicsIterator()
  {
    return this.topics.values().iterator();
  }
}